#pragma ocne
#include <iostream>

class GLFWwindow;
#define app Application::getInstance()

using ResizeCallback = void(*)(int width, int height);
using KeyBoardCallback = void(*)(int key, int action, int mods);

class Application
{
private:
    /* data */
    static Application* m_instance_;

    GLFWwindow* m_window_{nullptr};

    uint32_t m_height_{0};
    uint32_t m_width_{0};

    ResizeCallback mResizeCallback{ nullptr };

    KeyBoardCallback mKeyBoardCallback{ nullptr };

    Application(/* args */);

private:

    static void frameBufferSizeCallbak(GLFWwindow* window, int width, int height);
    static void keyCallback(GLFWwindow* window, int key, int scancode, int action, int mods);
public:
    static Application* getInstance();

    uint32_t getWidth() const;

    uint32_t getHeight() const;

    bool init(const int& width = 800, const int& height = 600);

    bool update();

    void destory();

    void setResizeCallback(ResizeCallback callback) {
        mResizeCallback = callback;
    }
    
    void setKeyBoardCallback(KeyBoardCallback callback) {
        mKeyBoardCallback = callback;
    }

    ~Application();
};


